/*------------------------------------------------------------------------------
 * PROJ : Prototype
 * NAME : sculove.spring.framework.tag.SearchConditionTag.java
 *        
 * Copyright 2010 sculove All rights reserved
 *------------------------------------------------------------------------------
*/
package sculove.spring.framework.tag;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import sculove.spring.framework.util.RequestUtil;
import sculove.spring.framework.util.SStringUtil;

/**
 * <pre>
 * sculove.spring.framework.tag.SearchConditionTag.java
 * 
 * 검색 조건 태그
 * 
 * 목록형에서 검색조건을 지정 
 * 
 * <f:param value="boardName"/> ==> 저장된 검색조건을 조회
 * <f:param/> ==> 목록에서 저장된 검색조건을 저장. (submit시, 저장된 검색조건을 함께 전달함)
 * 
 * </pre>
 * @date : 2010. 1. 6. 오후 5:05:08
 * @version :
 * @author : sculove
 * @deprecated
 */
public class SearchConditionTag extends TagSupport {
	private String value = "";
	
	@Override
	public int doStartTag() throws JspException {
		JspWriter out = pageContext.getOut();
		ServletRequest request = pageContext.getRequest();
		StringBuffer result = new StringBuffer();
		
		try {
			if(SStringUtil.hasText(value)) {
				result.append(RequestUtil.getParamValue((HttpServletRequest)request, value));
			} else {
				
			}
			
			result.append("</SELECT>");
			out.print(result.toString());
		} catch (Exception e) {
			Log logger = LogFactory.getLog(this.getClass());
			if (logger.isErrorEnabled()) {
				logger.error("SearchConditionTag Error!!!",e);
			}
			throw new JspException(e.getMessage());
		}

		return SKIP_BODY; // no body processing
	}
	

}
